package com.yangmin.springcloud.controller;

import com.yangmin.springcloud.service.IMessageProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class IMessageProviderController {
    @Value("${server.port}")
    private String port;
    @Autowired
    private IMessageProvider iMessageProvider;

    @GetMapping("/sendMessage")
    public String sendMessage() {
        String message = iMessageProvider.send();
        System.out.println("port:" + port + "-" + message);
        return null;
    }
}
